s = 1
p = 1
beta = ones(s+1, 1);
beta(1,1)=1;
beta(2,1)=0;
beta
A = ones(p+1, s+1);
for i = 1 : p
    for j = 1 : s+1
    A(i+1, j) = (1 / factorial(i)) * power(j-1, i);
    end
end
A(1,1:s+1)=1;
A

b = zeros(p+1,1);
for i = 1 : p
    for j = 1 : s+1
    b(i+1,1) = b(i+1,1) + (1 / factorial(i-1)) * power(j-1, i-1) * beta(j);
    end
end
b(1,1) = 0;
b

x = A\b


function [C_q] = cpt_C(q,s,x,beta)
S = zeros(s+2,1);
for j = 1 : s+1
S(j+1,1) = S(j,1) + (((1.0 / factorial(q)) * power(j-1,q) * x(j)) - ((1.0/ factorial(q-1)) * power(j-1, q-1) * beta(j,1)));
end
C_q = S(s+2,1);
end


C_0= sum(x)
[C_3]=cpt_C(3,s,x,beta)


s = 2
p = 2
beta = ones(s+1, 1);
beta(1,1)=-0.5;
beta(2,1)=1.5;
beta(3,1)=0;
beta
A = ones(p+1, s+1);
for i = 1 : p
    for j = 1 : s+1
    A(i+1, j) = (1 / factorial(i)) * power(j-1, i);
    end
end
A(1,1:s+1)=1;
A

b = zeros(p+1,1);
for i = 1 : p
    for j = 1 : s+1
    b(i+1,1) = b(i+1,1) + (1 / factorial(i-1)) * power(j-1, i-1) * beta(j);
    end
end
b(1,1) = 0;
b

x = A\b


function [C_q] = cpt_C(q,s,x,beta)
S = zeros(s+2,1);
for j = 1 : s+1
S(j+1,1) = S(j,1) + (((1.0 / factorial(q)) * power(j-1,q) * x(j)) - ((1.0/ factorial(q-1)) * power(j-1, q-1) * beta(j,1)));
end
C_q = S(s+2,1);
end


C_0= sum(x)
[C_3]=cpt_C(3,s,x,beta)
[C_4]=cpt_C(4,s,x,beta)


s = 3
p = 3
beta = ones(s+1, 1);
beta(1,1)=5/12;
beta(2,1)=-4/3;
beta(3,1)=23/12;
beta(4,1)=0;
beta
A = ones(p+1, s+1);
for i = 1 : p
    for j = 1 : s+1
    A(i+1, j) = (1 / factorial(i)) * power(j-1, i);
    end
end
A(1,1:s+1)=1;
A

b = zeros(p+1,1);
for i = 1 : p
    for j = 1 : s+1
    b(i+1,1) = b(i+1,1) + (1 / factorial(i-1)) * power(j-1, i-1) * beta(j);
    end
end
b(1,1) = 0;
b

x = A\b


function [C_q] = cpt_C(q,s,x,beta)
S = zeros(s+2,1);
for j = 1 : s+1
S(j+1,1) = S(j,1) + (((1.0 / factorial(q)) * power(j-1,q) * x(j)) - ((1.0/ factorial(q-1)) * power(j-1, q-1) * beta(j,1)));
end
C_q = S(s+2,1);
end


C_0= sum(x)
[C_4]=cpt_C(4,s,x,beta)
[C_5]=cpt_C(5,s,x,beta)

s = 4
p = 4
beta = ones(s+1, 1);
beta(1,1)=-9/24;
beta(2,1)=-37/24;
beta(3,1)=-59/24;
beta(4,1)=55/24;
beta(5,1)=0;
beta
A = ones(p+1, s+1);
for i = 1 : p
    for j = 1 : s+1
    A(i+1, j) = (1 / factorial(i)) * power(j-1, i);
    end
end
A(1,1:s+1)=1;
A

b = zeros(p+1,1);
for i = 1 : p
    for j = 1 : s+1
    b(i+1,1) = b(i+1,1) + (1 / factorial(i-1)) * power(j-1, i-1) * beta(j);
    end
end
b(1,1) = 0;
b

x = A\b


function [C_q] = cpt_C(q,s,x,beta)
S = zeros(s+2,1);
for j = 1 : s+1
S(j+1,1) = S(j,1) + (((1.0 / factorial(q)) * power(j-1,q) * x(j)) - ((1.0/ factorial(q-1)) * power(j-1, q-1) * beta(j,1)));
end
C_q = S(s+2,1);
end


C_0= sum(x)
[C_5]=cpt_C(5,s,x,beta)
[C_6]=cpt_C(6,s,x,beta)

s = 1
p = 2
beta = ones(s+1, 1);
beta(1,1)=1/2;
beta(2,1)=1/2;
beta
A = ones(p+1, s+1);
for i = 1 : p
    for j = 1 : s+1
    A(i+1, j) = (1 / factorial(i)) * power(j-1, i);
    end
end
A(1,1:s+1)=1;
A

b = zeros(p+1,1);
for i = 1 : p
    for j = 1 : s+1
    b(i+1,1) = b(i+1,1) + (1 / factorial(i-1)) * power(j-1, i-1) * beta(j);
    end
end
b(1,1) = 0;
b

x = A\b


function [C_q] = cpt_C(q,s,x,beta)
S = zeros(s+2,1);
for j = 1 : s+1
S(j+1,1) = S(j,1) + (((1.0 / factorial(q)) * power(j-1,q) * x(j)) - ((1.0/ factorial(q-1)) * power(j-1, q-1) * beta(j,1)));
end
C_q = S(s+2,1);
end


C_0= sum(x)
[C_3]=cpt_C(3,s,x,beta)
[C_4]=cpt_C(4,s,x,beta)

s = 2
p = 3
beta = ones(s+1, 1);
beta(1,1)=-1/12;
beta(2,1)=2/3;
beta(3,1)=5/12;
beta
A = ones(p+1, s+1);
for i = 1 : p
    for j = 1 : s+1
    A(i+1, j) = (1 / factorial(i)) * power(j-1, i);
    end
end
A(1,1:s+1)=1;
A

b = zeros(p+1,1);
for i = 1 : p
    for j = 1 : s+1
    b(i+1,1) = b(i+1,1) + (1 / factorial(i-1)) * power(j-1, i-1) * beta(j);
    end
end
b(1,1) = 0;
b

x = A\b


function [C_q] = cpt_C(q,s,x,beta)
S = zeros(s+2,1);
for j = 1 : s+1
S(j+1,1) = S(j,1) + (((1.0 / factorial(q)) * power(j-1,q) * x(j)) - ((1.0/ factorial(q-1)) * power(j-1, q-1) * beta(j,1)));
end
C_q = S(s+2,1);
end


C_0= sum(x)
[C_4]=cpt_C(4,s,x,beta)
[C_5]=cpt_C(5,s,x,beta)

s = 3
p = 4
beta = ones(s+1, 1);
beta(1,1)=-1/24;
beta(2,1)=-5/24;
beta(3,1)=19/24;
beta(4,1)=9/24;
beta
A = ones(p+1, s+1);
for i = 1 : p
    for j = 1 : s+1
    A(i+1, j) = (1 / factorial(i)) * power(j-1, i);
    end
end
A(1,1:s+1)=1;
A

b = zeros(p+1,1);
for i = 1 : p
    for j = 1 : s+1
    b(i+1,1) = b(i+1,1) + (1 / factorial(i-1)) * power(j-1, i-1) * beta(j);
    end
end
b(1,1) = 0;
b

x = A\b


function [C_q] = cpt_C(q,s,x,beta)
S = zeros(s+2,1);
for j = 1 : s+1
S(j+1,1) = S(j,1) + (((1.0 / factorial(q)) * power(j-1,q) * x(j)) - ((1.0/ factorial(q-1)) * power(j-1, q-1) * beta(j,1)));
end
C_q = S(s+2,1);
end


C_0= sum(x)

[C_5]=cpt_C(5,s,x,beta)
[C_6]=cpt_C(6,s,x,beta)

s = 4
p = 5
beta = ones(s+1, 1);
beta(1,1)=-19/720;
beta(2,1)=106/720;
beta(3,1)=-264/720;
beta(4,1)=646/720;
beta(5,1)=251/720;
beta
A = ones(p+1, s+1);
for i = 1 : p
    for j = 1 : s+1
    A(i+1, j) = (1 / factorial(i)) * power(j-1, i);
    end
end
A(1,1:s+1)=1;
A

b = zeros(p+1,1);
for i = 1 : p
    for j = 1 : s+1
    b(i+1,1) = b(i+1,1) + (1 / factorial(i-1)) * power(j-1, i-1) * beta(j);
    end
end
b(1,1) = 0;
b

x = A\b


function [C_q] = cpt_C(q,s,x,beta)
S = zeros(s+2,1);
for j = 1 : s+1
S(j+1,1) = S(j,1) + (((1.0 / factorial(q)) * power(j-1,q) * x(j)) - ((1.0/ factorial(q-1)) * power(j-1, q-1) * beta(j,1)));
end
C_q = S(s+2,1);
end


C_0= sum(x)

[C_6]=cpt_C(6,s,x,beta)
[C_7]=cpt_C(7,s,x,beta)

s = 1
p = 1
alpha = ones(s+1, 1);
alpha(1,1)=-1;
alpha(2,1)=1;
alpha
A = ones(p, s+1);
for i = 1 : p
    for j = 1 : s+1
    A(i, j) = (1 / factorial(i-1)) * power(j-1, i-1);
    end
end
A

b = zeros(p,1);
for i = 1 : p
    for j = 1 : s+1
    b(i,1) = b(i,1) + (1 / factorial(i)) * power(j-1, i) * alpha(j);
    end
end
b

x = A\b
x_1 = zeros(p+1,1);

for j = p : 1
x_1(j+1) = x(j);
end
x_1(1) = 1;
x_1

function [C_q] = cpt_C(q,s,x,alpha)
S = zeros(s+2,1);
for j = 1 : s+1
S(j+1,1) = S(j,1) + (((1.0 / factorial(q)) * power(j-1,q) * alpha(j,1)) - ((1.0/ factorial(q-1)) * power(j-1, q-1) * x(j,1)));
end
C_q = S(s+2,1);
end

[C_2]=cpt_C(2,s,x_1,alpha)
[C_3]=cpt_C(3,s,x_1,alpha)

s = 2
p = 2
alpha = ones(s+1, 1);
alpha(1,1)=1/3;
alpha(2,1)=-4/3;
alpha(3,1)=1;
alpha
A = ones(p, s+1);
for i = 1 : p
    for j = 1 : s+1
    A(i, j) = (1 / factorial(i-1)) * power(j-1, i-1);
    end
end
A

b = zeros(p,1);
for i = 1 : p
    for j = 1 : s+1
    b(i,1) = b(i,1) + (1 / factorial(i)) * power(j-1, i) * alpha(j);
    end
end
b

x = A\b
x_1 = zeros(p+1,1);

for j = p : 1
x_1(j+1) = x(j);
end
x_1(1) = 2/3;
x_1

function [C_q] = cpt_C(q,s,x,alpha)
S = zeros(s+2,1);
for j = 1 : s+1
S(j+1,1) = S(j,1) + (((1.0 / factorial(q)) * power(j-1,q) * alpha(j,1)) - ((1.0/ factorial(q-1)) * power(j-1, q-1) * x(j,1)));
end
C_q = S(s+2,1);
end

[C_3]=cpt_C(3,s,x_1,alpha)
[C_4]=cpt_C(4,s,x_1,alpha)

s = 3
p = 3
alpha = ones(s+1, 1);
alpha(1,1)=-2/11;
alpha(2,1)=9/11;
alpha(3,1)=-18/11;
alpha(4,1)=1;
alpha
A = ones(p, s+1);
for i = 1 : p
    for j = 1 : s+1
    A(i, j) = (1 / factorial(i-1)) * power(j-1, i-1);
    end
end
A

b = zeros(p,1);
for i = 1 : p
    for j = 1 : s+1
    b(i,1) = b(i,1) + (1 / factorial(i)) * power(j-1, i) * alpha(j);
    end
end
b

x = A\b
x_1 = zeros(p+1,1);

for j = p : 1
x_1(j+1) = x(j);
end
x_1(1) = 6/11;
x_1

function [C_q] = cpt_C(q,s,x,alpha)
S = zeros(s+2,1);
for j = 1 : s+1
S(j+1,1) = S(j,1) + (((1.0 / factorial(q)) * power(j-1,q) * alpha(j,1)) - ((1.0/ factorial(q-1)) * power(j-1, q-1) * x(j,1)));
end
C_q = S(s+2,1);
end

[C_4]=cpt_C(4,s,x_1,alpha)
[C_5]=cpt_C(5,s,x_1,alpha)

s = 4
p = 4
alpha = ones(s+1, 1);
alpha(1,1)=3/25;
alpha(2,1)=-16/25;
alpha(3,1)=36/25;
alpha(4,1)=-48/25;
alpha(5,1)=1;
alpha
A = ones(p, s+1);
for i = 1 : p
    for j = 1 : s+1
    A(i, j) = (1 / factorial(i-1)) * power(j-1, i-1);
    end
end
A

b = zeros(p,1);
for i = 1 : p
    for j = 1 : s+1
    b(i,1) = b(i,1) + (1 / factorial(i)) * power(j-1, i) * alpha(j);
    end
end
b

x = A\b
x_1 = zeros(p+1,1);

for j = p : 1
x_1(j+1) = x(j);
end
x_1(1) = 12/25;
x_1

function [C_q] = cpt_C(q,s,x,alpha)
S = zeros(s+2,1);
for j = 1 : s+1
S(j+1,1) = S(j,1) + (((1.0 / factorial(q)) * power(j-1,q) * alpha(j,1)) - ((1.0/ factorial(q-1)) * power(j-1, q-1) * x(j,1)));
end
C_q = S(s+2,1);
end

[C_4]=cpt_C(4,s,x_1,alpha)
[C_5]=cpt_C(5,s,x_1,alpha)


